<!-- video.js -->
<link href="static/video-js/video-js.min.css" rel="stylesheet">

<script src="static/scripts/jquery.min.js"></script>
<script type="text/javascript" src="js/common.js"></script>
<script type="text/javascript" src="js/base64.js"></script>
<script type="text/javascript" src="js/DocSys.js"></script>
<!-- DPlayer
<script src="static/DPlayer/DPlayer.min.js"></script>
 -->
<!-- video.js -->
<script src="static/video-js/video.js"></script>

<div align=center style="margin-top:0px" >
	<!-- HTML5 Default Mode --> 
    <!-- <video id="videoPlayer" name="videoPreview" src="" controls="controls" style="display:none;max-width:60%; max-height:60%;"></video>
    -->
    <!-- VideoJs Mode  -->
    <video-js id="videoPlayer" class="video-js vjs-big-play-centered vjs-fluid" 
    	webkit-playsinline="" x-webkit-airplay="allow" playsinline="" controls
        crossorigin="anonymous" 
        style="display:none;"></video-js>
    <!-- DPlayer Mode -->
    <!-- <div id="videoPlayer"></div> -->
</div>  

<script type="text/javascript">
    function GetRequest() {
        var url = location.search; //获取url中"?"符后的字串
        var theRequest = {};
        if (url.indexOf("?") !== -1) {
            var str = url.substr(1);
            var strs = str.split("&");
            for(var i = 0; i < strs.length; i ++) {
                theRequest[strs[i].split("=")[0]]=unescape(strs[i].split("=")[1]);
            }
        }
        return theRequest;
    }
    var params = GetRequest();
    var docid = params['docid'];
    //获取artDialog父窗口传递过来的参数
    var artDialog2 = window.top.artDialogList['ArtDialog'+docid];
    if (artDialog2 == null) {
        artDialog2 = window.parent.artDialogList['ArtDialog' + docid];
    }
    // 获取对话框传递过来的数据
    var docInfo = artDialog2.config.data;
	console.log("videoViewerForArt.html => docInfo:",docInfo);
	
	docInfo.fileSuffix = getFileSuffix(docInfo.name);
    getDocFileLink(docInfo, showVideo, showErrorMessage);    	
    
    function showVideo(fileLink)
   	{
		$("#videoPlayer").show();
		$("#videoPlayer").attr('src', fileLink);	
		var type = getVideoTypeByFileSuffix(docInfo.fileSuffix);;
		showVideoWithVideojs('videoPlayer', fileLink, type);	
		//showVideoWithDPlayer('videoPlayer', fileLink);

   	}
   </script>
